package fr.loof.fonzie;

import java.util.Iterator;

import javax.persistence.EntityManager;
import javax.persistence.Query;

/**
 * General purpose definition of a query on the EntityManager.
 * 
 * @author <a href="nicolas@apache.org">Nicolas De Loof</a>
 */
public interface PersistenceQuery
{
    /**
     * Parameter names in the query
     */
    Iterator<String> parameters();

    Class getEntity();

    /**
     * build a JPA query using the entityManager for execution
     */
    Query createQuery( EntityManager entityManager );

}